home *** CD-ROM | disk | FTP | other *** search
Modula Definition | 1997-04-23 | 2.5 KB | 89 lines | [TEXT/3PRM] |
- definition module commonDef;
-
- // Version 0.8 to 1.0.
-
- //
- // Common types for the event I/O system:
- //
-
- from StdString import String;
-
- from mac_types import Rect, WindowPtr, Toolbox;
- from deltaPicture import Rectangle, Point;
-
- :: ItemTitle :== String;
-
- :: SelectState = Able | Unable;
- :: MarkState = Mark | NoMark;
-
- :: KeyboardState :== (!KeyCode, !KeyState, !Modifiers);
- :: KeyCode :== Char;
- :: KeyState = KeyUp | KeyDown | KeyStillDown;
-
- :: MouseState :== (!MousePosition, !ButtonState, !Modifiers);
- :: MousePosition :== (!Int, !Int);
- :: ButtonState = ButtonUp | ButtonDown
- | ButtonDoubleDown | ButtonTripleDown | ButtonStillDown;
-
- /* Modifiers indicates the meta keys that have been pressed (True) or
- not (False): (Shift, Option, Command, Control)
- */
-
- :: Modifiers :== (!Bool, !Bool, !Bool, !Bool);
-
- :: PictureDomain :== Rectangle;
-
-
- :: Cond x :== x -> Bool;
-
-
- SelectStateEqual :: !SelectState !SelectState -> Bool;
- MarkEqual :: !MarkState !MarkState -> Bool;
- ButtonStateEqual :: !ButtonState !ButtonState -> Bool;
- Enabled :: !SelectState -> Bool;
- Checked :: !MarkState -> Bool;
- MarkSwitch :: !MarkState -> MarkState;
- KeyMapToModifiers :: !(!Int,!Int,!Int,!Int) -> Modifiers;
- INTToModifiers :: !Int -> Modifiers;
- ModifiersToINT :: !Modifiers -> Int;
-
- InGrafport :: !WindowPtr !(Toolbox -> (x, Toolbox)) !Toolbox -> (!x, !Toolbox);
- InGrafport2 :: !WindowPtr !(Toolbox -> Toolbox) !Toolbox -> Toolbox;
-
- LocalToGlobal :: !Point !Toolbox -> (!Point,!Toolbox);
- GlobalToLocal :: !Point !Toolbox -> (!Point,!Toolbox);
-
- If :: !Bool x x -> x;
-
- ABS :: !Int -> Int;
- Dist :: !Int !Int -> Int;
- Min :: !Int !Int -> Int;
- Max :: !Int !Int -> Int;
- SetBetween :: !Int !Int !Int -> Int;
- IsBetween :: !Int !Int !Int -> Bool;
-
- ABSR :: !Real -> Real;
-
- RectangleToRect :: !Rectangle -> Rect;
- IsEmptyRect :: !Rect -> Bool;
-
- Head :: ![x] -> x;
- Tail :: ![x] -> [x];
- IsEmptyList :: ![x] -> Bool;
- Reverse :: ![x] [x] -> [x];
- Concat :: ![x] ![x] -> [x];
- Map :: !(x -> y) ![x] -> [y];
- StateMap :: !(x -> .s -> (y, .s)) ![x] .s -> (![y], .s);
- StateMap2 :: !(x -> .s -> .s) ![x] !.s -> .s;
- Remove :: !(Cond x) x ![x] -> (!Bool, x, ![x]);
- Append :: ![.x] !.x -> [.x];
- Length_new :: ![x] -> Int;
-
- RemoveCheckInt :: ![Int] !Int -> (!Bool, ![Int]);
- ContainsInt :: ![Int] !Int -> Bool;
-
- RemoveChar :: ![Char] !Char -> [Char];
- ContainsChar :: ![Char] !Char -> Bool;
-
- Error :: !String !String !String -> .x;
-